//
//  PersonTools.h
//  BaseTools
//
//  Created by 李挺哲 on 15/12/30.
//  Copyright © 2015年 ltz. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Person.h"
#import <CoreData/CoreData.h>
@interface PersonTools : NSObject
@property(strong,nonatomic)NSManagedObjectContext * context;
@property(strong,nonatomic)  NSPersistentStoreCoordinator * psc;
@property(strong,nonatomic)    NSManagedObjectModel *model ;

+ (instancetype)shareInstanceWithStoreName:(NSString *)storeName ;
/**
 *  添加一个 Person
 *
 *  @param person <#person description#>
 */
-(void)saveWithPerson:(Person *)person;




/**
 *  获取所有的Person对象
 *
 *  @return <#return value description#>
 */
- (NSMutableArray *)persons;



/**
 *  获取搜索的Person对象
 *
 *  @return <#return value description#>
 */
-(NSMutableArray *)getSearchPersons :(NSString *)text;


-(BOOL)deletePerson:(Person *)person;



@end
